/**
 * @file bsp_pwm.h
 * @brief 基于定时器的PWM驱动
 * @author wangh (wanghuan3037@fiberhome.com)
 * @version 1.0
 * @date 2021-03-19
 * @copyright Copyright (c) 2021  烽火通信
 */
#ifndef __BSP_PWM_H
#define __BSP_PWM_H 
#include <stdint.h>
#include <stdbool.h>
#include "bsp.h"
#include "bsp_gpio.h"

/**
 * @brief UART外设编号
 */
typedef enum
{
    TIMER_1,
    TIMER_2,
    TIMER_3,
    TIMER_4,
    TIMER_5,
    TIMER_6,
    TIMER_7,
    TIMER_8,
    TIMER_9,
    TIMER_10,
    TIMER_11,
    TIMER_12,
    TIMER_13,
    TIMER_14,
}TimerId_t;

/** @brief  */
typedef struct 
{
    uint8_t channel;    /* pwm通道0-n */
    uint32_t period;    /* pwm计数周期 */
    uint32_t duty;     /* 占空比 */
    
} pwm_config_t;


/** @brief  */
typedef struct 
{
    TimerId_t TimerId;  ///< Timer外设编号

    

    uint32_t pwm_frequency;
    uint32_t period;

    rcu_periph_enum RCU_TIMERx;
    uint32_t TIMERx;

    
} Pwm_t;


#endif	 // __BSP_PWM_H 

/*********** (C) COPYRIGHT 2021 FiberHome *****END OF FILE****/
